1. Field of the Invention
The present invention generally relates to the field of computer implemented artificial intelligence and expert systems and, more particularly, to providing declarative programming capabilities within procedural programming languages such as JavaScript.TM., Java.TM. and Hypertext Markup Language.TM. (HTML.TM.)
2. Description of the Prior Art
While it has long been accepted that any function can be derived from a general purpose computer using a small number of basic operations, many moderate or high-level programming languages have been developed which facilitate expression of algorithms for performance of specific types of functions and interfacing with programmers having particular types of expertise. For example, FORTRAN.TM. has been popular for many years for performing computationally intensive algorithms often encountered in scientific and engineering endeavors.
More recently, C++.TM. has become popular for so-called object-oriented programming. Even more recently, Java.TM., JavaScript.TM. and HTML.TM. have become popular for development of pages and links for communication interfaces over networks such as the internet World Wide Web.TM. since they are general purpose languages, source code and object platform independent and potentially secure while being similar to other popular languages such as C++.TM.. JavaScript.TM., in particular, has allowed some small degree of intelligent behavior to be incorporated in such interfaces by inclusion of so-called in-line programs which are called and run upon presentation of the interface in which they are included. Java.TM. can be used to provide even more sophisticated behaviors in similar environments. All of these recently developed programming languages are essentially procedural within the context of a degree of concurrency characteristic of object-oriented programming.
Artificial intelligence and expert systems have received much attention in recent years in an effort to provide automatic adaptive behavior of computer functions. For example, by accumulation of correlations between conditions (e.g. stimuli) and an operator's choice between available options in response thereto, the operator's preferences and logic can be modeled and computer operation adaptively changed to anticipate those choices to facilitate the operator's interaction with the system. Similarly, complex logical responses to theoretically vast amounts of data can be analyzed and modeled in algorithms to simulate the analysis of an expert in a particular field of such data, operator input or a combination thereof. Such applications are particularly useful in complex and/or extensive design and scheduling applications to check user inputs against previously specified portions of the design to insure consistency, compatibility and the like.
Many artificial intelligence and expert system algorithms are implemented in familiar procedural programming in which an ordered sequence of steps embodied in the program is followed as the program is run. That is, the procedure implicit in the order of the steps as presented by the program is invariant other than for conditional or unconditional branching operations which are, themselves, reached only in the order in which they are placed in the algorithm. The order of steps specified in the program is resumed following the branching operation at the sequentially following address or at the address to which branching is directed. By the same token, the conditions upon which conditional branching is to be performed involve the comparison of a particular piece of information against a specific criterion. For that reason, imprecise or heuristic reasoning cannot be easily coded using a procedural language.
So-called declarative or rule-based programming has been developed to facilitate matching of complex patterns which are necessarily involved in simulation of reasoning and evaluation of information against imprecise criteria. At a very high level of abstraction, declarative programming principally differs from procedural programming by allowing operations to be specified without a specification of order in which they are executed. Thus, the equivalent of a conditional branching operation is a self-contained rule comprising a condition and an action which is permitted where appropriate to the condition. A potentially complex and extensive set or collection of rules may thus be applied to a collection of data (which may also be very large) to derive a subset of data for which all rules are true.
Evaluation against imprecise criteria can also be more easily achieved with declarative programming than with procedural since the operation performed on data can update or change parameters or attributes of the data objects being evaluated, including the creation or deletion of attributes and invalidation of prior matches. Performance of the matching operation and implementation of any user-specified priority is optimized by particular algorithms such as the so-called RETE algorithm or its derivatives and, more recently, the TREAT and "Lazy Evaluation" algorithms which are familiar to those skilled in the art. The TREAT and Lazy Evaluation algorithms, in particular, provide fast matching for less complex match situations with a significant reduction in memory requirements.
Many network environments present severe limitations on code size and complexity when code must be transmitted over the network at a relatively low data transfer rate imposed by the communication link. Therefore, use of procedural programming to provide intelligent behavior of the system is effectively precluded beyond a very low functional level in order to provide acceptable response time. In other words, programs which must be downloaded before they can be run and which are specific to information which is also transmitted over the network do not yield acceptable response times unless the amount of code contained in the application program is extremely limited. Such brief application programs are thus referred to as Applets. Other environments, such as monitoring and automatic control of geographically extensive manufacturing or communication systems, present requirements for rapid response over a very large body of data which cannot be accommodated by applying a complex procedural algorithm exhaustively against an extremely large body of data which may be widely distributed, as well.
In both of these environments, however, a requirement for source code and object platform independence has limited programming code to programming languages which are strictly procedural in nature. Therefore, there has existed no practical way to increase the very limited amount of intelligent behavior which can be made available consistent with acceptable downloading time. Similarly, there has been no alternative to procedural programming when source code and object platform independence must be accommodated which may make execution time unacceptable due to algorithm complexity, database size or both even if downloading of the program is not a factor in response time.